/*
 * Copyright the original author or authors.
 * 
 * Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.mozilla.org/MPL/MPL-1.1.html
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.kairos.commands
{
	/**
	 * <code>CommandManagerRT</code> is a singleton version of the
	 * <code>CommandRT</code> class.
	 * 
	 * @author  Cédric Néhémie 
	 * @see		com.kairos.commands.CommandRT
	 */
	public class CommandManagerRT extends CommandRT
	{
		private static var _oInstance : CommandManagerRT;
		
		/**
		 * Singleton constructor.
		 */
		public function CommandManagerRT ( access : PrivateCommandManagerRTConstructorAccess )
		{
			super( false );
		}
		
		/**
		 * Returns the sole instance of the <code>CommandManagerRT</code>
		 * class.
		 * 
		 * @return <code>CommandManagerRT</code> sole instance.
		 */
		public static function getInstance() : CommandManagerRT
		{
			return (_oInstance) ? _oInstance : CommandManagerRT._init();
		}
		
		/**
		 * Deletes the sole instance of the <code>CommandManagerRT</code>
		 * class.
		 */
		public static function release() : void
		{
			_oInstance.removeAll();
			_oInstance = null;
		}
		
		private static function _init() : CommandManagerRT
		{
			_oInstance = new CommandManagerRT( new PrivateCommandManagerRTConstructorAccess() );
			return _oInstance;
		}
	}
}
internal class PrivateCommandManagerRTConstructorAccess {}